Decoder and encoder and methods for coding of a video sequence

ABSTRACT

An encoder calculates an indication to a previous reference picture having temporal identity of zero. The encoder creates a first set of indicators to the previous reference picture, to all reference pictures in a first reference picture set of the previous reference picture, and to all pictures following the previous reference picture in decoding order and precede the current picture in decoding order. The encoder sets a flag for picture order count cycle, when a long term reference picture (LTRP) has least significant bits (LSBs) of a picture order count, for which more than one picture in the first set share same value of the LSBs of picture order count as the LTRP. The decoder obtains LSB of a picture order count for a LTRP in a reference picture set of the current picture. The decoder concludes non-compliant bitstream based on indications provided by the flag.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.15/984,573, filed 21 Feb. 2018, which itself is a continuation of U.S.patent application Ser. No. 15/014,543, filed 3 Feb. 2016 (now U.S. Pat.No. 9,998,758), which itself is a continuation of U.S. patentapplication Ser. No. 14/420,408, filed 9 Feb. 2015 (now U.S. Pat. No.9,300,965), which itself is a 35 U.S.C. § 371 national stage applicationof PCT International Application No. PCT/EP2013/077229, filed on 18 Dec.2013, which itself claims the benefit of U.S. provisional patentApplication No. 61/753,158, filed 16 Jan. 2013, the disclosures andcontents of which are incorporated by reference herein in theirentirety. The above-referenced PCT International Application waspublished in the English language as International Publication No. WO2014/111222 A1 on 24 Jul. 2014.

TECHNICAL FIELD

Embodiments herein relate to video coding. In particular, a decoder anda method therein for decoding a bitstream to obtain a video sequence aswell as an encoder and a method therein for encoding a video sequenceare disclosed. Moreover, corresponding computer programs and computerprogram products are disclosed.

BACKGROUND

With video coding technologies, it is often desired to compress a videosequence into a coded video sequence. The video sequence may for examplehave been captured by a video camera. A purpose of compressing the videosequence is to reduce a size, e.g. in bits, of the video sequence. Inthis manner, the coded video sequence will require smaller memory whenstored and/or less bandwidth when transmitted from e.g. the videocamera. A so called encoder is often used to perform compression, orencoding, of the video sequence. Hence, the video camera may comprisethe encoder. The coded video sequence may be transmitted from the videocamera to a display device, such as a television set (TV) or the like.In order for the TV to be able to decompress, or decode, the coded videosequence, it may comprise a so called decoder. This means that thedecoder is used to decode the received coded video sequence. In otherscenarios, the encoder may be comprised in a radio base station of acellular communication system and the decoder may be comprised in awireless device, such as a cellular phone or the like, and vice versa.

A known video coding technology is called High Efficiency Video Coding(HEVC), which is a new video coding standard, currently being developedby Joint Collaborative Team-Video Coding (JCT-VC). JCT-VC is acollaborative project between Moving Pictures Expert Group (MPEG) andInternational Telecommunication Union's TelecommunicationStandardization Sector (ITU-T).

HEVC is a hybrid codec that use multiple reference pictures for interprediction. HEVC includes a picture marking process in which referencepictures can be marked as “used for short-term reference”, “used forlong-term reference” and “unused for reference”. If marked “unused forreference”, the picture cannot be used for inter prediction any more.The marking process in HEVC is controlled by Reference Picture Sets(RPSs). An RPS is a set of picture identifiers that identifies referencepictures. The set is sent in each slice and reference pictures will bekept in the Decoded Picture Buffer (DPB) if they are present in the RPS.A slice is a spatially distinct region of a frame that is encodedindependently from any other region in the same frame. The RPS part ofthe slice segment header syntax is shown in Table 1.

Pictures in HEVC are identified by their Picture Order Count (POC)values, also known as full POC values. Each slice contains a code word,pic_order_cnt_lsb, that shall be the same for all slices in a picture.pic_order_cnt_lsb is also known as the least significant bits (lsb) ofthe full POC since is it a fixed-length code word and only the leastsignificant bits of the full POC is signaled. Both encoder and decoderkeep track of POC wrap-around so that full POC values can be assigned toeach picture that is encoded/decoded.

Short-term pictures are indicated in the RPS through a pair of numbers,the POC of the reference picture and a flag: used_by_curr_pic_lx_flag.The decoder knows the POC of the reference pictures in the DPB and canmatch those against the POC values received in the RPS. The flagused_by_curr_pic_lx_flag indicates whether the reference picture is usedfor reference for the current picture or not.

Long-term pictures are generally indicated in the RPS by the leastsignificant bit (lsb) part of the POC value of the reference picture.However, the HEVC standard has an optional codeword,delta_poc_msb_cycle_lt_minus1, which provides an alternative way ofreferencing long-term pictures. The long-term picture part of the HEVCslice header syntax is shown at the end of Table 1.

TABLE 1 RPS slice header syntax De- scrip- tor slice_segment_header( ) {...  if( !IdrPicFlag ) {   pic_order_cnt_lsb u(v)  short_term_ref_pic_set_sps_flag u(1)   if(!short_term_ref_pic_set_sps_flag)    short_term_ref_pic_set(num_short_term_ref_pic_sets )   else    short_term_ref_pic_set_idx u(v)  if( long_term_ref_pics_present_flag ) {    if(num_long_term_ref_pics_sps > 0)     num_long_term_sps ue(v)   num_long_term_pics ue(v)    for( i = 0; i < num_long_term_sps +num_long_term_pics; i++ ) {     if( i < num_long_term_sps)     lt_idx_sps[ i ] u(v)     else {      poc_lsb_lt[ i ] u(v)     used_by_curr_pic_lt_flag[ i ] u(1)     }    delta_poc_msb_present_flag[ i ] u(1)     if(delta_poc_msb_present_flag[ i ] )      delta_poc_msb_cycle_lt[ i ] ue(v)   }   }

If delta_poc_msb_present_flag is equal to 0, the long-term picture isindicated by the lsb part of its POC only. If delta_poc_msb_present_flagis equal to 1, the long-term picture is indicated by the full POC, i.e.the lsb part of POC and a POC msb cycle used to calculate the msb partof POC. delta_poc_msb_present_flag equal to 1 allows for two long-termpictures to share the same POC lsb. The HEVC standard currently mandatesthat delta_poc_msb_present_flag shall be equal to 1 whenever there areat least two reference pictures in the DPB with the same POC lsb. Thisis restricted by the following sentence in the draft HEVC specification,where DeltaPocLt is a list that holds all POC lsb of the long-termpictures in the RPS:

-   -   delta_poc_msb_present_flag[i] shall be equal to 1 when there is        more than one reference picture in the decoded picture buffer        with picture order count modulo MaxPicOrderCntLsb equal to        PocLsbLt[i].

This restriction says that when a long-term picture is being indicatedby an RPS and there are more than one reference pictures in the decodedpicture buffer with the same POC lsb as that long-term picture, thelong-term picture indication shall include the signaling of the POC msbcycle, i.e. delta_poc_msb_present_flag shall be equal to 1 for thatlong-term picture indication in the RPS.

An HEVC bitstream consists of one or more Coded Video Sequences (CVS). Acoded video sequence starts, in decoding order, with a first picturethat has a picture type that does not use any other picture forprediction and for which all pictures that are present in the DPB aremarked “unused for reference” so that no picture in a CVS uses picturesin another CVS for reference. A CVS consists of a series of access unitsthat are sequential in a NAL unit stream, see below, and use only oneSequence Parameter Set (SPS). SPS is defined as a special type of NALunit, e.g. SPS_NUT. The SPS contains information that is valid for anentire coded video sequence such as picture size or cropping windowparameters that are applied to pictures when they are output from thedecoder.

HEVC defines temporal sub-layers. For each picture the variableTemporalId, calculated from the syntax element nuh_temporal_id_plus1, inthe NAL unit header, indicates which temporal sub-layer the picturebelongs to. A lower temporal sub-layer cannot depend on a highertemporal sub-layer and a sub-bitstream extraction process requires thatwhen one or more of the highest temporal sub-layers are removed from abitstream the remaining bitstream shall be a conforming bitstream. As anexample, lower temporal sub-layers may be associated with a displayrate, or bit rate, that is lower than a display rate, or a bit rate,corresponding to a higher temporal sub-layer. It shall be understoodthat temporal sub-layers enable sub-bitstream extraction by only lookingat NAL unit headers, it is not necessary to decode other parts of thebitstream.

In HEVC, the encoded pictures are encapsulated in one or more NetworkAbstraction Layer (NAL) units, forming part of an access unit. NAL unitsare classified as Video Coding Layer (VCL) units or non-VCL NAL units,such as the above mentioned SPS, according to whether they contain codedpicture samples or contain other associated data, respectively. In theHEVC standard, all VCL NAL units of the same picture are required tohave the same NAL unit type, which indicates properties about theencoded picture and may affect the decoding process. The NAL unit types;TRAIL_N, TSA_N, STSA_N, RASL_N and RADL_N are used to indicate that thispicture is not used for reference by any picture of the same temporalsub-layer. In this text those pictures are referred to as Non-ReferenceTemporal Sub-Layer (NRTSL) pictures. The NAL unit types RSV_VCL_N10,RSV_VCL_N12, or RSV_VCL_N14 are reserved for use in future versions ofthe HEVC specification but they are already now required to have theproperties of NRTSL pictures and may thus be considered to be NRTSLpictures even though it is not yet allowed to use these NAL unit typesin conforming bit streams. All other picture types are in this textreferred to as Reference Temporal Sub-Layer (RTSL) pictures.

For a NRTSL picture X, if the temporal sub-layer that X belongs to isthe highest temporal sub-layer that is decoded it will be possible toremove X, i.e. all the NAL units carrying the picture X, from thebitstream without affecting decodability of the remaining stream.However, the DPB might contain different pictures when the picture Ythat follows X in decoding order is to be decoded depending on if X wasdecoded or discarded. It might be the case that, when a picture X isremoved, the DPB could contain two long-term reference pictures in theDPB with the same POC lsb when Y is decoded but this would not have beenthe case if X would have been received. Therefore, the encoder may haveused delta_poc_msb_present_flag equal to 0 for a case for which that isok when X is present in the bitstream but violates the constraintpreviously mentioned when X has been removed. The decoding process forthis case is undefined. Thus, for this case it is not possible to removeX from the bitstream without affecting decodability of the remainingstream.

The same situation can occur when removing individual pictures fromhigher temporal sub-layers.

Consider the following example:

-   -   8 bits are used for pic_order_cnt_lsb. This means that POC lsb        values are in the range of 0 to 255, inclusive. The POC of the        picture X is 257 and pictures with POC 0 and 256 are both        long-term pictures that are present in the DPB marked as “used        for long-term reference”. Both of these long-term reference        pictures will have POC lsb equal to 0. Assume that only the        picture with POC 0 is present in the RPS of picture X, i.e. the        picture with POC 256 shall be removed from the DPB. HEVC        contains the restriction,    -   delta_poc_msb_present_flag[i] shall be equal to 1 when there is        more than one reference picture in the decoded picture buffer        with picture order count modulo MaxPicOrderCntLsb equal to        PocLsbLt[i].

Thus, picture X must signal delta_poc_msb_present_flag equal to 1 forthe picture with POC 0.

When the RPS of picture X has been decoded there will only be onepicture in the DPB with POC lsb equal to 0.

Assume that picture Y follows X in decoding order, has POC 258, andindicates in its RPS that the long-term picture with POC equal to 0shall be kept as a reference picture in the DPB. When Y is decoded therewill only be one picture in the DPB with POC lsb equal to 0. Thus, it isnot required that delta_poc_msb_present_flag is equal to 1 for thatpicture in the RPS of picture Y.

If X was a NRTSL picture in the same temporal sub-layer as Y or if X wasencoded in a higher temporal sub-layer than Y then it should be possibleto remove X without affecting the decodability of Y. However, if pictureX is removed, there will be two long-term reference pictures in the DPBwith POC lsb equal to 0 and since delta_poc_msb_present_flag is equal to0 for the long-term reference picture with POC lsb equal to 0 in the RPSof Y, it is not defined in the decoding process which one of thesepictures to keep as a reference picture in the DPB. Thus, the remainingbit stream is not decodable and the intent of the NRTSL picture type andtemporal layering is broken.

SUMMARY

An object may be how to improve encoding of HEVC compliant bitstreams.

According to a first aspect, the object is achieved by a method,performed by an encoder, for encoding a video sequence. When encoding acurrent picture of the video sequence, the encoder performs thefollowing. The encoder calculates an indication to a previous referencepicture. The previous reference picture is located before the currentpicture in decoding order. The previous reference picture is, relativelyto the current picture, a closest previous reference picture, indecoding order, that has a temporal identity equal to zero. The encodercreates a first set of indicators to previous pictures. The first setcomprises the indication to the previous reference picture, a second setof indicators to all reference pictures included in a first ReferencePicture Set (RPS) of the previous reference picture, and a third set ofindicators to all pictures that follow the previous reference picture indecoding order and precede the current picture in decoding order. When along term reference picture in a second RPS of the current picture hasleast significant bits of a picture order count, for which more than onepicture indicated in the first set share the same value of the leastsignificant bits of picture order count as the long term referencepicture, the encoder sets a flag for the long term reference picture.The flag indicates use of a picture order count cycle and leastsignificant bits of the picture order count for indicating the long termreference picture in the second RPS.

According to a second aspect, the object is achieved by an encoderconfigured to encode a video sequence. The encoder is configured asfollows to encode a current picture of the video sequence. Accordingly,the encoder is configured to calculate an indication to a previousreference picture. The previous reference picture is located before thecurrent picture in decoding order. The previous reference picture is,relatively to the current picture, a closest previous reference picture,in decoding order, that has a temporal identity equal to zero. Moreover,the encoder is configured to create a first set of indicators toprevious pictures. The first set comprises the indication to theprevious reference picture, a second set of indicators to all referencepictures included in a first RPS of the previous reference picture, anda third set of indicators to all pictures that follow the previousreference picture in decoding order and precede the current picture indecoding order. Furthermore, the encoder is configured to set a flag forthe long term reference picture, when a long term reference picture in asecond RPS of the current picture has least significant bits of apicture order count, for which more than one picture indicated in thefirst set share the same value of the least significant bits of pictureorder count as the long term reference picture. The flag indicates useof a picture order count cycle and least significant bits of the pictureorder count for indicating the long term reference picture in the secondRPS.

According to a third aspect, the object is achieved by a method,performed by a decoder, for decoding a bitstream to obtain a videosequence. When decoding a current picture from the bitstream the decoderperforms the following. The decoder obtains, from the bitstream, leastsignificant bits of a picture order count for a long term referencepicture included in a reference picture set of the current picture. Thedecoder obtains a flag for said long term reference picture. The flagindicates whether or not to use a picture order count cycle. When theflag indicates that the picture order count cycle is not used and theleast significant bits match more than one reference picture in adecoded picture buffer of the decoder, the decoder concludes that thebitstream is a non-compliant bitstream.

According to a fourth aspect, the object is achieved by a decoderconfigured to decode a bitstream to obtain a video sequence. The decoderis configured as follows to decode a current picture from the bitstream.Accordingly, the decoder is configured to obtain, from the bitstream,least significant bits of a picture order count for a long termreference picture included in a reference picture set of the currentpicture. Moreover, the decoder is configured to obtain a flag for saidlong term reference picture. The flag indicates whether or not to use apicture order count cycle. Furthermore, the decoder is configured toconclude that the bitstream is a non-compliant bitstream, when the flagindicates that the picture order count cycle is not used and the leastsignificant bits match more than one reference picture in a decodedpicture buffer of the decoder.

According to a fifth aspect, the object is achieved by a method,performed by an encoder, for encoding a video sequence. When encoding acurrent picture of the video sequence and for each long term referencepicture in a RPS of the current picture, the encoder performs thefollowing. The encoder stores a respective picture order count of saideach long term reference picture in a list of picture order counts. Whenthe list includes a picture order count that is different from therespective picture order count and when the picture order count hasleast significant bits that are equal to least significant bits of therespective picture order count, the encoder sets a flag for said eachlong term reference picture. The flag indicates use of a picture ordercount cycle and least significant bits of the picture order count forindicating the long term reference picture in the RPS of the currentpicture.

According to a sixth aspect, the object is achieved by an encoderconfigured to encode a video sequence. The encoder is configured asfollows to encode a current picture of the video sequence and for eachlong term reference picture in a RPS of the current picture.Accordingly, the encoder is configured to store a respective pictureorder count of said each long term reference picture in a list ofpicture order counts. Moreover, the encoder is configured to set a flagfor said each long term reference picture, when the list includes apicture order count that is different from the respective picture ordercount and when the picture order count has least significant bits thatare equal to least significant bits of the respective picture ordercount. The flag indicates use of a picture order count cycle and leastsignificant bits of the picture order count for indicating the long termreference picture in the RPS of the current picture.

According to a seventh aspect, the object is achieved by a computerprogram comprising computer readable code units which when executed onan encoder causes the encoder to perform the methods described herein.

According to an eighth aspect, the object is achieved by a computerprogram product, comprising computer readable medium and a computerprogram, as mentioned directly above, stored on the computer readablemedium.

According to a ninth aspect, the object is achieved by a computerprogram comprising computer readable code units which when executed on adecoder causes the decoder to perform the methods described herein.

According to a tenth aspect, the object is achieved by a computerprogram product, comprising computer readable medium and a computerprogram, as mentioned directly above, stored on the computer readablemedium.

Thanks to that the encoder carefully check when to set the flag,ambiguities regarding long-term picture indications in HEVC, whentemporal layers have been removed, are avoided. Thus, at least one ofthe embodiments herein provides the ability to remove pictures from thebitstream without affecting decodability of the stream when the picturehas a type or belongs to a temporal sub-layer such that it should bepossible to remove.

BRIEF DESCRIPTION OF THE DRAWINGS

The various aspects of embodiments disclosed herein, includingparticular features and advantages thereof, will be readily understoodfrom the following detailed description and the accompanying drawings,in which:

FIG. 1 is a schematic overview of an exemplifying system in whichembodiments herein may be implemented,

FIG. 2 is a block diagram illustrating relation between picture ordercount, decoding order and reference picture set,

FIG. 3 is a schematic, combined signaling scheme and flowchartillustrating embodiments of the methods when performed in the systemaccording to FIG. 1,

FIG. 4 is a flowchart illustrating embodiments of the method in theencoder,

FIG. 5 is a further flowchart illustrating embodiments of the method inthe encoder,

FIG. 6 is a block diagram illustrating embodiments of the encoder,

FIG. 7 is another block diagram illustrating embodiments of the encoder,

FIG. 8 is a further block diagram illustrating embodiments of theencoder,

FIG. 9 is a flowchart illustrating embodiments of the method in thedecoder,

FIG. 10 is a block diagram illustrating embodiments of the decoder,

FIG. 11 is another block diagram illustrating embodiments of thedecoder, and

FIG. 12 is a further block diagram illustrating embodiments of thedecoder.

DETAILED DESCRIPTION

Throughout the following description similar reference numerals havebeen used to denote similar elements, units, modules, circuits, nodes,parts, items or features, when applicable. In the Figures, features thatappear in some embodiments may be indicated by dashed lines.

FIG. 1 depicts a scenario in which embodiments herein are implemented inan exemplifying system 100. The system comprises a decoder 50 and anencoder 80.

The decoder 50 and/or the encoder 80 may be comprised in televisionset-top-boxes, video players/recorders, such as video cameras, Blu-rayplayers, Digital Versatile Disc (DVD)-players, media centers, mediaplayers and the like.

FIG. 2 illustrates relations between Picture Order Count (POC), decodingorder and Reference Picture Set (RPS). For decoding of a picture certainso called reference pictures are used 201-207 as reference pictures. Asan example, for decoding of picture with POC=1, pictures POC=0 and POC=2are used 201, 202 as reference pictures. A Reference Picture Set (RPS)includes POC values of these reference pictures, e.g. RPS=[0, 2]. Notethat the RPS may comprise further pictures than those indicated here forpicture POC=1.

The POC values refer to an order in which pictures of a coded videosequence are to be output, or displayed when shown to a viewer, e.g. auser, a person, a detector and the like. The POC value is indicated in aslice header of a current picture.

Decoding order refer to an order in which pictures of a coded videosequence are to be decoded. In FIG. 2, pictures “b” requires thatpictures “B” are decoded before the pictures “b” can be decoded.

Looking at FIG. 2, picture with POC=1 is a previous picture to picturewith POC=2 respect to POC, or output order, since 1<2. However, picture“B” with POC=2 is a previous picture to picture “b” with POC=1 withrespect to decoding order as described above.

Reference Picture Set (RPS) refers to which pictures are to be keptmarked as reference pictures. This means that for a current picture, thedecoding thereof does not have to use all reference pictures in the DPB,e.g. some pictures may be marked as reference pictures for future use.Hence, for picture with POC=1, we have that the RPS is [0, 2] since thearrows in FIG. 2 indicate that pictures with POC=0 and POC=2 needs to bedecoded before picture with POC=1 can be decoded. In practice, the RPSof the picture with POC=1 must also include POC=4 since that picture isused when decoding the picture with POC=3.

Moreover, a first temporal layer t0 with temporal identity equal to zerois illustrated. Increasingly higher temporal layers t1, t2 are alsoshown. A purpose of temporal layers is to partition pictures into layerssuch that a higher temporal layer may be removed, e.g. from a bitstream,without affecting decodability of pictures belonging to lower layers. Asa consequence, it is defined that a lower temporal layer cannot use apicture in a higher temporal layer as a reference picture. \

FIG. 3 illustrates exemplifying methods in the decoder 50 and theencoder 80, which are shown in FIG. 1. Thus, the encoder 80 performs amethod for encoding a video sequence, and the decoder 50 performs amethod for decoding a bitstream 310 to obtain a video sequence. Thevideo sequence may be comprised in the bitstream 310, e.g. in the formof a coded video sequence. The bitstream may be a HEVC compliantbitstream.

Action 301 to 304 may be performed when encoding a current picture ofthe video sequence. Action 305 to 307 may be performed when decoding acurrent picture from the bitstream.

Action 301

In order to be able to possibly use an indication in action 302, theencoder 80 calculates the indication to a previous reference picture.The previous reference picture is located before the current picture indecoding order. The previous reference picture is, relatively to thecurrent picture, a closest previous reference picture, in decodingorder, that has a temporal identity equal to zero.

In some examples, the indication to the previous reference picture maybe the previous reference picture itself, which sometimes is denotedprevTid0Pic. Therefore, the indication may be the previous picture indecoding order that has TemporalId equal to 0 and is not a RASL picture,a RADL picture, or a sub-layer non-reference picture.

The temporal identity of the previous reference picture may be indicatedin a previous NAL unit of the previous reference picture.

Action 302

In order to keep track of which POC values have been used, the encoder80 creates a first set of indicators to previous pictures. The first setcomprises:

-   -   the indication to the previous reference picture,    -   a second set of indicators to all reference pictures included in        a first RPS of the previous reference picture, and    -   a third set of indicators to all pictures that follow the        previous reference picture, indicated by the indication, in        decoding order and precede the current picture in decoding        order.

It shall be understood that the expression “indicator to” may mean thatthe indicator points to some picture.

The first reference picture set may be comprised in a previous sliceheader of the previous reference picture.

Action 303

Action 303 is performed when a long term reference picture in a secondRPS of the current picture has least significant bits of a picture ordercount, for which more than one picture indicated in the first set sharethe same value of the least significant bits of picture order count asthe long term reference picture. Thus, when this action is performed,the encoder 80 sets a flag for the long term reference picture. Thismeans e.g. that the encoder 80 assigns the flag a value of one. The flagindicates use of a picture order count cycle and least significant bitsof the picture order count for indicating the long term referencepicture in the second RPS. The second RPS may comprise the long termreference picture or a pointer thereto. Therefore, the long termreference picture may in some examples be a long term reference pictureindication.

Sometimes, the flag may be referred to as delta_poc_msb_present_flag.Moreover, the picture order count cycle may be referred to asdelta_poc_msb_cycle_lt.

The picture order count may indicate order in which pictures of thevideo sequence are to be output, e.g. to a display device, such as a TVor the like.

When a long term reference picture in the second RPS of the currentpicture has least significant bits of a picture order count, for whichzero or one picture indicated in the first set share the same value ofthe least significant bits of picture order count as the long termreference picture, the encoder 80 clears the flag, e.g. assigns a valueof zero to the flag.

Action 304

In order to inform the decoder 50 about the picture order count cycle,the encoder 80 may encode the picture order count cycle into the currentNAL unit of the current picture. Thus, the bitstream 310 may comprisethe picture order count cycle.

Action 305

In order to be able to perform action 307, the decoder 50 obtains, fromthe bitstream, least significant bits of a picture order count for along term reference picture included in a reference picture set of thecurrent picture. In relation to action 305, the picture order count inthe RPS is used to indicate which pictures to keep as reference picturesin the DPB. The picture order count indicates order in which pictures ofthe video sequence are to be output.

The least significant bits may be obtained from the current NAL unit.

Action 306

Also in order to be able to perform action 307, the decoder 50 obtains aflag for said long term reference picture. The flag indicates whether ornot to use a picture order count cycle. The flag may have been encodedinto the bitstream by the encoder 80.

Each picture of the bitstream may comprise at least one NAL unit. Eachpicture may be decoded from a slice comprised in said at least one NALunit. The slice may comprise a slice header. The slice header maycomprise the flag. The current picture of the video sequence may bedecoded from a current slice, having a current slice header. The currentslice may be decoded from a current NAL unit. In some examples, saideach picture comprises a plurality of NAL units. Thus, there may be aplurality of slices for said each picture.

Action 307

When the flag indicates that the picture order count cycle is not usedand the least significant bits, obtained in action 305, match more thanone reference picture in a decoded picture buffer of the decoder 50, thedecoder 50 concludes that the bitstream is a non-compliant bitstream,e.g. non-compliance to HEVC. The decoded picture buffer may comprisepictures decoded before, in decoding order, the current picture.

According to some first embodiments, let prevTid0Pic be the previousRTSL picture in decoding order that has TemporalId equal to 0, i.e. thelowest temporal sub-layer. As an example, prevTid0Pic may be theprevious picture in decoding order that has TemporalId equal to 0 and isnot a RASL picture, a RADL picture, or a sub-layer non-referencepicture.

In these first embodiments a restriction is imposed on the bitstream.The restriction applies when there are at least two pictures with thesame POC lsb in the set of pictures consisting of; prevTid0Pic, thepictures in the RPS of prevTid0Pic, and all pictures that followsprevTid0Pic in decoding order and precedes the current picture indecoding order. Moreover, when applying the restriction, it will thenimply that syntax elements, such as POC msb cycle, used to calculate thefull POC value must be signaled for the long-term pictures with thatsame POC lsb that is included in the RPS of the current picture.

An alternative way of expressing the restriction is that a long-termreference picture Z has to be signaled with delta_poc_msb_present_flagequal to 1 when there are at least two pictures with POC lsb equal tothe POC lsb of Z in the set of pictures consisting of: prevTid0Pic, thepictures in the RPS of prevTid0Pic, and all pictures that followsprevTid0Pic in decoding order and precedes the current picture indecoding order.

One way of formulating the restriction is:

-   -   Let prevTid0Pic be the previous picture in decoding order that        has nal_unit_type not equal to TRAIL_N, TSA_N, STSA_N, RADL_N        nor RASL_N and that has TemporalId equal to 0.

Let setOfPreviousPictures be the set consisting of:

-   -   prevTid0Pic    -   all the pictures in the RPS of prevTid0Pic    -   all the pictures that follows prevTid0Pic in decoding order and        precedes the current picture in decoding order.

delta_poc_msb_present_flag[i] shall be equal to 1 when there is morethan one picture in the setOfPreviousPictures with picture order countmodulo MaxPicOrderCntLsb equal to PocLsbLt[i].

Alternatively prevTid0Pic is deduced as:

-   -   Let prevTid0Pic be the previous reference picture in decoding        order that has TemporalId equal to 0.    -   Alternatively PrevTidPic is defined globally for example as:        PrevTid0Pic is set equal to the previous picture in decoding        order that has nal_unit_type not equal to TRAIL_N, TSA_N,        STSA_N, RADL_N, RASL_N, RSV_VCL_N10, RSV_VCL_N12 or RSV_VCL_N14        and that has TemporalId equal to 0.

The restriction is then formulated as: Let setOfPreviousPictures be theset consisting of:

-   -   PrevTid0Pic    -   all the pictures in the RPS of PrevTid0Pic    -   all the pictures that follows PrevTid0Pic in decoding order and        precedes the current picture in decoding order.

delta_poc_msb_present_flag[i] shall be equal to 1 when there is morethan one reference picture in the setOfPreviousPictures with pictureorder count modulo MaxPicOrderCntLsb equal to PocLsbLt[i].

An encoder may be configured to use the embodiment according to thefollowing steps:

-   1. The encoder stores (or calculates) the information of which    picture is the PrevTid0Pic, i.e. the previous picture in decoding    order that has nal_unit_type not equal to TRAIL_N, TSA_N, STSA_N,    RADL_N, RASL_N, RSV_VCL_N10, RSV_VCL_N12 or RSV_VCL_N14 and that has    TemporalId equal to 0.-   2. A set, setOfPreviousPictures, is created consisting of    PrevTid0Pic, all the pictures in the RPS of PrevTid0Pic and all the    pictures that follows PrevTid0Pic in decoding order and precedes the    current picture in decoding order.-   3. Whenever the encoder wishes to signal a long-term reference    picture in the RPS that has a POC lsb for which there are more than    one picture in setOfPreviousPictures with the same POC lsb, then    delta_poc_msb_present_flag is signaled equal to 1 for that picture,    i.e. the POC msb cycle is signaled for that picture.

Expressed in a different way an encoder may be configured to use theembodiment according to the following steps:

-   1. The encoder stores (or calculates) the information of which    picture is the PrevTid0Pic, i.e. the previous picture in decoding    order that is not a non-reference picture in its temporal sub-layer    and that has TemporalId equal to 0.-   2. A set, setOfPreviousPictures, is created consisting of    PrevTid0Pic, all the pictures in the RPS of PrevTid0Pic and all the    pictures that follows PrevTid0Pic in decoding order and precedes the    current picture in decoding order.-   3. Whenever the encoder wishes to signal a long-term reference    picture in the RPS that has a POC lsb for which there are more than    one picture in setOfPreviousPictures with the same POC lsb, then    delta_poc_msb_present_flag is signaled equal to 1 for that picture,    i.e. the POC msb cycle is signaled for that picture.

Alternatively PrevTid0Pic is defined as

-   -   PrevTid0Pic is set equal to the previous temporal sub-layer        reference picture in decoding order that has TemporalId equal to        0.

A Reference Temporal Sub-Layer (RTSL) picture is then defined as apicture that has nal_unit_type not equal to TRAIL_N, TSA_N, STSA_N,RADL_N, RASL_N, RSV_VCL_N10, RSV_VCL_N12 or RSV_VCL_N14.

A decoder may use the embodiment according to the following steps

-   1. The decoder receives a slice and parses syntax elements in the    slice segment header including the RPS related syntax elements.-   2. If there are two reference pictures in the DPB, such as one    short-term and one long-term reference picture, two long-term    reference pictures or the like, with the same POC lsb and the    current RPS contains an entry with PocLsbLt[i] equal to that POC lsb    and delta_poc_msb_present_flag equal to 0, the decoder concludes    that the bitstream is not compliant with the HEVC standard and can    interpret that as a bit-error, loss of data or non-compliant    bitstream or encoder. It may report the error, perform error    concealment or take other actions based on the knowledge that the    bitstream is not compliant. The decoder further concludes that the    bitstream was not created from an HEVC compliant bitstream through    removal of one or more individual pictures from higher temporal    layers or through removal of a NRTSL picture from the same temporal    layer as the current picture.

In some second embodiments the encoder is configured to perform thefollowing steps:

-   -   1. For each current picture that is to be encoded the following        steps are performed:        -   a. For every picture A that is used as a long-term reference            picture, the following steps are performed:            -   i. the POC value of A is stored by the encoder in a                list: usedLongTermPocValues.            -   ii. If there is a POC value in usedLongTermPocValues                that is different from the POC value of A but with a POC                lsb that is equal to the POC lsb of A then A is                determined to be signaled with POC msb cycle.        -   b. The RPS of the current picture is signaled with            delta_poc_msb_present_flag set according to what was            determined in step a.ii.

This method is also illustrated in FIG. 5 below.

In one version of the embodiment the list usedLongTermPocValues is reset(emptied) when the encoder starts encoding a new CVS, i.e. not for eachnew picture.

In another version of the embodiment there is a bitstream restrictionthat requires that when two different pictures with the same POC lsb inthe same coded video sequence are used as long-term reference picturesthen POC msb cycle must be signaled for those pictures.

In the current HEVC design, removal of pictures from higher temporalsub-layers or removal of individual Non-Reference Temporal Sub-Layer(NRTSL) pictures from the same temporal sub-layer can create a bitstreamthat is not decodable due that it is undefined which long-term pictureto mark as “unused for reference” when there are two long-term picturesin the DPB with the same POC lsb and the current RPS contains only areference to one of them and delta_poc_msb_present_flag is equal to 0for this reference.

The basic concept of the embodiments is to enforce a restriction so thatremoval of pictures that are non-reference pictures of a temporalsub-layer does not affect decodability of the remaining stream. That isachieved according to the embodiments described below.

According to a first aspect an encoder is configured to implement arestriction so that removal of pictures that are non-reference picturesof a temporal sub-layer does not affect decodability of the remainingstream. “Decodability” is understood to mean the possibility to decode.

A receiver comprising the encoder is also provided.

According to a second aspect a method in an encoder for implementing arestriction so that removal of pictures that are non-reference picturesof a temporal sub-layer does not affect decodability of the remainingstream.

The encoder and/or the decoder can be implemented in a device such as avideo camera or a rendering device.

Yet a further related aspect of the embodiments defines a computerprogram for encoding a picture. The computer program comprises codemeans, such as computer program text or binary files, which when run bya processor causes the processor to perform one or more embodimentsherein.

Another additional aspect of the embodiments relates to a computerprogram product comprising computer readable medium and a computerprogram stored on the computer readable medium.

According to a further aspect a decoder is provided. The decoder isconfigured to receive information relating to the restriction and to usethe restriction when decoding the picture.

The embodiments apply to a decoder, an encoder and any element thatoperates on a bitstream, such as a network node or a Media Aware NetworkElement (MANE).

The embodiments are not limited to HEVC but may be applied to anyextension of HEVC, such as a scalable extension or multi-view extensionor to a different video coding standard.

In FIG. 4, an exemplifying, schematic flowchart of the method in theencoder 80 is shown. As mentioned, the encoder 80 performs a method forencoding a video sequence.

As mentioned, the video sequence may be encoded into a bitstream, whichmay be a HEVC compliant bitstream.

Each picture of the bitstream may comprise at least one NAL unit,wherein each picture may be encoded into at least one slice comprised insaid at least one NAL unit. The at least one slice may comprise a sliceheader. The slice header may comprise the flag. The current picture ofthe video sequence may be encoded into at least one current slice. Theat least one current slice is encoded into a current NAL unit.

When encoding a current picture of the video sequence, the followingactions may be performed in any suitable order.

Action 401

The encoder 80 calculates an indication to a previous reference picture.As mentioned, the previous reference picture is located before thecurrent picture in decoding order. The previous reference picture is,relatively to the current picture, a closest previous reference picture,in decoding order, that has a temporal identity equal to zero. Thisaction is similar to action 301.

Action 402

The encoder 80 creates a first set of indicators to previous pictures.The first set comprises:

-   -   the indication to the previous reference picture,    -   a second set of indicators to all reference pictures included in        a first reference picture set, “RPS”, of the previous reference        picture, and    -   a third set of indicators to all pictures that follow the        previous reference picture in decoding order and precede the        current picture in decoding order.

The first reference picture set may be comprised in a previous sliceheader of the previous reference picture. This action is similar toaction 302.

Action 403

The encoder 80 sets a flag for the long term reference picture. The flagindicates use of a picture order count cycle and least significant bitsof the picture order count for indicating the long term referencepicture in the second RPS. Action 403 is performed when a long termreference picture in a second RPS of the current picture has leastsignificant bits of a picture order count, for which more than onepicture indicated in the first set share the same value of the leastsignificant bits of picture order count as the long term referencepicture. The picture order count may indicate order in which pictures ofthe video sequence are to be output. This action is similar to action303.

Action 404

The encoder 80 may encode the picture order count cycle into the currentNAL unit of the current picture. This action is similar to action 304.

In FIG. 5, an exemplifying, schematic flowchart of the method accordingto the second embodiments in the encoder 80 is shown. As mentioned, theencoder 80 performs a method for encoding a video sequence.

The following actions may be performed in any suitable order.

Action 501

The encoder 80 may reset the list when the current picture may be afirst picture of the video sequence, e.g. CVS.

When encoding a current picture of the video sequence, the followingactions may be performed for each long term reference picture in aReference Picture Set, “RPS” of the current picture:

Action 502

The encoder 80 stores a respective picture order count of said each longterm reference picture in a list for picture order counts. This actionis similar to step 1.a.i above.

Action 503

The encoder 80 sets a flag for said each long term reference picture,when the list includes a picture order count that is different from therespective picture order count and when the picture order count, e.g. inthe list, has least significant bits that are equal to least significantbits of the respective picture order count. The flag indicates use of apicture order count cycle and least significant bits of the pictureorder count for indicating the long term reference picture in the RPS ofthe current picture. This action is similar to step 1.a.ii above.

FIG. 6 is a schematic block diagram of an encoder 601 configured toencode a picture according to an embodiment. The encoder comprises arestriction unit 602, configured to apply the restriction according toany of the described embodiments. Moreover, the encoder comprises anoutput unit 603 configured to generate and output the bitstream.

Now in more detail, with reference to FIG. 7, there is illustrated inmore detail the encoder 80 configured to encode a video sequence. Theencoder 80 is configured to, when encoding a current picture of thevideo sequence, calculate an indication to a previous reference picture.The previous reference picture is located before the current picture indecoding order. The previous reference picture is, relatively to thecurrent picture, a closest previous reference picture, in decodingorder, that has a temporal identity equal to zero.

Furthermore, the encoder 80 is configured to, when encoding a currentpicture of the video sequence, create a first set of indicators toprevious pictures. The first set comprises:

-   -   the indication to the previous reference picture,    -   a second set of indicators to all reference pictures included in        a first reference picture set, “RPS”, of the previous reference        picture, and    -   a third set of indicators to all pictures that follow the        previous reference picture in decoding order and precede the        current picture in decoding order.

Moreover, the encoder 80 is configured to, when encoding a currentpicture of the video sequence, set a flag for the long term referencepicture, when a long term reference picture in a second RPS of thecurrent picture has least significant bits of a picture order count, forwhich more than one picture indicated in the first set share the samevalue of the least significant bits of picture order count as the longterm reference picture. The flag indicates use of a picture order countcycle and least significant bits of the picture order count forindicating the long term reference picture in the second RPS.

The encoder 80 may further be configured to encode the picture ordercount cycle into the current NAL unit of the current picture.

Each picture of the bitstream may comprise at least one NAL unit,wherein each picture may be encoded into at least one slice comprised insaid at least one NAL unit. The at least one slice may comprise a sliceheader. The slice header may comprise the flag. The current picture ofthe video sequence may be encoded into at least one current slice. Theat least one current slice may be encoded into a current NAL unit.

The temporal identity of the previous reference picture may be indicatedin a previous NAL unit of the previous reference picture.

The first reference picture set may be comprised in a previous sliceheader of the previous reference picture.

The picture order count may indicate order in which pictures of thevideo sequence are to be output.

The bitstream may be a HEVC compliant bitstream.

Furthermore, according to the second embodiments, the encoder 80 isconfigured to encode a video sequence.

The encoder 80 is configured to, when encoding a current picture of thevideo sequence and for each long term reference picture in a RPS of thecurrent picture, store a respective picture order count of said eachlong term reference picture in a list for picture order counts.

Moreover, the encoder 80 is configured to, when encoding a currentpicture of the video sequence and for each long term reference picturein a RPS of the current picture, set a flag for said each long termreference picture, when the list includes a picture order count that isdifferent from the respective picture order count and when the pictureorder count has least significant bits that are equal to leastsignificant bits of the respective picture order count. The flagindicates use of a picture order count cycle and least significant bitsof the picture order count for indicating the long term referencepicture in the RPS of the current picture.

The encoder 80 may further be configured to reset the list when thecurrent picture may be a first picture of the video sequence.

Thus, the encoder 80 described herein could be implemented e.g. by oneor more of a processor 82, or processing circuit, and adequate softwarewith suitable storage or memory 84 therefore, a programmable logicdevice (PLD) or other electronic component(s) as shown in FIG. 7. Inaddition, the encoder 80 preferably comprises an input or input unit 81configured to receive the pictures of the video stream. A correspondingoutput or output unit 83 is configured to output the encodedrepresentations of the slices, preferably in the form of NAL units.

The encoder of FIG. 7 with its including units could be implemented inhardware. There are numerous variants of circuitry elements that can beused and combined to achieve the functions of the units of the encoder.Such variants are encompassed by the embodiments. Particular examples ofhardware implementation of the encoder are implementation in digitalsignal processor (DSP) hardware and integrated circuit technology,including both general-purpose electronic circuitry andapplication-specific circuitry.

FIG. 7 also illustrates a computer program 85 comprising computerreadable code units which when executed on the encoder 80 causes theencoder 80 to perform the method according to FIG. 3, 4 or 5.

Finally, FIG. 7 illustrates a computer program product 86, comprisingcomputer readable medium 87 and the computer program 85 as describeddirectly above stored on the computer readable medium 87.

The computer readable medium may be a memory, a Universal Serial Bus(USB) memory, a DVD-disc, a Blu-ray disc, a software module that isreceived as a stream of data, a Flash memory, a hard drive etc.

Now referring to FIG. 8, an encoder 62 according to embodiments hereinmay, for example, be located in a transmitter 60 in a video camera e.g.in a mobile device. The transmitter 60 then comprises an input or inputunit 61 configured to receive pictures of a video stream to be encoded.The pictures are encoded by the encoder 62 as disclosed herein. Encodedpictures are output from the transmitter 60 by an output or output unit63 in the form of a coded bitstream, such as of NAL units or datapackets carrying such NAL units.

In FIG. 9, an exemplifying, schematic flowchart of a method, performedby the decoder 50, for decoding a bitstream to obtain a video sequence,is shown.

When decoding a current picture from the bitstream, the followingactions may be performed in any suitable order.

Action 901

The decoder 50 obtains, from the bitstream, least significant bits of apicture order count for a long term reference picture included in areference picture set of the current picture. The least significant bitsmay be obtained from the current NAL unit. This action is similar toaction 305.

Action 902

The decoder 50 obtains a flag for said long term reference picture. Theflag indicates whether or not to use a picture order count cycle. Thisaction is similar to action 306.

Each picture of the bitstream may comprise at least one NAL unit,wherein each picture may be decoded from a slice comprised in said atleast one NAL unit. The slice may comprise a slice header. The sliceheader may comprise the flag. The current picture of the video sequencemay be decoded from a current slice, having a current slice header. Thecurrent slice may be decoded from a current NAL unit.

Action 903

The decoder 50 concludes that the bitstream is a non-compliantbitstream, when the flag indicates that the picture order count cycle isnot used and the least significant bits match more than one referencepicture in a decoded picture buffer of the decoder 50.

The decoded picture buffer may comprise pictures decoded before, indecoding order, the current picture. The concluding includes concludingnon-compliance to HEVC. This action is similar to action 307.

FIG. 10 is a simplified schematic block diagram of a decoder 1001according to the embodiments. The decoder comprises an input unit 1002configured to receive the bitstream having the restriction according toany of the above described embodiments. The decoder further comprises adecoding unit 1003 which is configured to use this restriction whendecoding the picture.

FIG. 11 shows a block diagram of the decoder 50 configured to decode abitstream to obtain a video sequence.

The decoder 50 is configured to, when decoding a current picture fromthe bitstream, obtain from the bitstream least significant bits of apicture order count for a long term reference picture included in areference picture set of the current picture.

Furthermore, the decoder 50 is configured to, when decoding the currentpicture from the bitstream, obtain a flag for said long term referencepicture. The flag indicates whether or not to use a picture order countcycle.

Moreover, the decoder 50 is configured to, when decoding the currentpicture from the bitstream, conclude that the bitstream is anon-compliant bitstream, when the flag indicates that the picture ordercount cycle is not used and the least significant bits match more thanone reference picture in a decoded picture buffer of the decoder 50.

The picture order count indicates order in which pictures of the videosequence are to be output.

Each picture of the bitstream may comprise at least one NAL unit,wherein each picture may be decoded from a slice comprised in said atleast one NAL unit. The slice may comprise a slice header. The sliceheader may comprise the flag. The current picture of the video sequencemay be decoded from a current slice, having a current slice header. Thecurrent slice may be decoded from a current NAL unit.

The least significant bits may be obtained from the current NAL unit.

The decoded picture buffer may comprise pictures decoded before, indecoding order, the current picture.

The decoder 50 may further be configured to conclude non-compliance toHEVC.

The decoder of FIG. 11 with its including units could be implemented inhardware. There are numerous variants of circuitry elements that can beused and combined to achieve the functions of the units of the decoder.Such variants are encompassed by the embodiments. Particular examples ofhardware implementation of the decoder are implementation in digitalsignal processor (DSP) hardware and integrated circuit technology,including both general-purpose electronic circuitry andapplication-specific circuitry.

The decoder 50 described herein could alternatively be implemented e.g.by one or more of a processor 52, processing circuit, and adequatesoftware with suitable storage or memory 54 therefore, a programmablelogic device (PLD) or other electronic component(s) as shown in FIG. 11.In addition, the decoder 50 preferably comprises an input or input unit51 configured to receive the encoded representations of pictures, suchas in the form of NAL (Network Abstraction Layer) units. A correspondingoutput or output unit 53 is configured to output the decoded pictures.

Typically the reference picture buffer is an integrated part of thedecoder 50. The memory 54 may contain the reference picture buffer plusother things needed for decoding.

FIG. 11 also illustrates a computer program 55 comprising computerreadable code units which when executed on the decoder 50 causes thedecoder 50 to perform the method as illustrated in FIGS. 3 and 9.

Finally, FIG. 11 shows a computer program product 56, comprisingcomputer readable medium 57 and a computer program 55 as describeddirectly above stored on the computer readable medium 57.

The computer readable medium may be a memory, a Universal Serial Bus(USB) memory, a DVD-disc, a Blu-ray disc, a software module that isreceived as a stream of data, a Flash memory, a hard drive etc.

Now referring to FIG. 12, a decoder 32 according to embodiments hereincan, for example, be located in a receiver 30, such as in a videocamera, set-top-box or a display, e.g. in a mobile device. The receiver30 then comprises an input or input unit 31 configured to receive acoded bitstream, such as data packets of NAL units. The encodedrepresentations of the NAL units are decoded by the decoder 32 asdisclosed herein. The decoder 32 preferably comprises or is connected toa reference picture buffer 34 that temporarily stores already decodedpictures that are to be used as reference pictures for other pictures inthe video stream. Pictures in a reference picture set may be stored inthe reference picture buffer. Decoded pictures are output from thereceiver 30, such as from the reference picture buffer 34, by means ofan output or output unit 33. These output pictures are sent to bedisplayed to a user on a screen or display of or connected, includingwirelessly connected, to the receiver 30. The output pictures may alsobe stored on disk or transcoded without display.

The embodiments are not limited to HEVC but may be applied to anyextension of HEVC such as a scalable extension or multi-view extensionor to a different video codec. The embodiments are applicable to 2D and3D video.

It is to be understood that the choice of interacting units or modules,as well as the naming of the units are only for exemplary purpose, andmay be configured in a plurality of alternative ways in order to be ableto execute the disclosed process actions.

It should also be noted that the units or modules described in thisdisclosure are to be regarded as logical entities and not with necessityas separate physical entities. It will be appreciated that the scope ofthe technology disclosed herein fully encompasses other embodimentswhich may become obvious to those skilled in the art, and that the scopeof this disclosure is accordingly not to be limited.

Reference to an element in the singular is not intended to mean “one andonly one” unless explicitly so stated, but rather “one or more.” Allstructural and functional equivalents to the elements of theabove-described embodiments that are known to those of ordinary skill inthe art are expressly incorporated herein by reference and are intendedto be encompassed hereby. Moreover, it is not necessary for a device ormethod to address each and every problem sought to be solved by thetechnology disclosed herein, for it to be encompassed hereby.

In the preceding description, for purposes of explanation and notlimitation, specific details are set forth such as particulararchitectures, interfaces, techniques, etc. in order to provide athorough understanding of the disclosed technology. However, it will beapparent to those skilled in the art that the disclosed technology maybe practiced in other embodiments and/or combinations of embodimentsthat depart from these specific details. That is, those skilled in theart will be able to devise various arrangements which, although notexplicitly described or shown herein, embody the principles of thedisclosed technology. In some instances, detailed descriptions ofwell-known devices, circuits, and methods are omitted so as not toobscure the description of the disclosed technology with unnecessarydetail. All statements herein reciting principles, aspects, andembodiments of the disclosed technology, as well as specific examplesthereof, are intended to encompass both structural and functionalequivalents thereof. Additionally, it is intended that such equivalentsinclude both currently known equivalents as well as equivalentsdeveloped in the future, e.g. any elements developed that perform thesame function, regardless of structure.

Thus, for example, it will be appreciated by those skilled in the artthat block diagrams herein can represent conceptual views ofillustrative circuitry or other functional units embodying theprinciples of the technology. Similarly, it will be appreciated that anyflow charts, state transition diagrams, pseudo code, and the likerepresent various processes which may be substantially represented incomputer readable medium and so executed by a computer or processor,whether or not such computer or processor is explicitly shown.

The functions of the various elements including functional blocks may beprovided through the use of hardware such as circuit hardware and/orhardware capable of executing software in the form of coded instructionsstored on computer readable medium. Thus, such functions and illustratedfunctional blocks are to be understood as being eitherhardware-implemented and/or computer-implemented, and thusmachine-implemented.

Thus, for example, it will be appreciated by those skilled in the artthat block diagrams herein can represent conceptual views ofillustrative circuitry or other functional units embodying theprinciples of the technology. Similarly, it will be appreciated that anyflow charts, state transition diagrams, pseudo code, and the likerepresent various processes which may be substantially represented incomputer readable medium and so executed by a computer or processor,whether or not such computer or processor is explicitly shown.

The embodiments described above are to be understood as a fewillustrative examples of the present invention. It will be understood bythose skilled in the art that various modifications, combinations andchanges may be made to the embodiments without departing from the scopeof the present invention. In particular, different part solutions in thedifferent embodiments can be combined in other configurations, wheretechnically possible.

As used herein, the term “set” when used in conjunction with e.g. a flagmay mean that a value of one is assigned to the flag.

As used herein, the term “clear” when used in conjunction with e.g. aflag may mean that a value of zero is assigned to the flag.

The invention claimed is:
 1. A method for encoding a video sequence intoa bitstream, wherein the bitstream is a High Efficiency Video Coding“HEVC” compliant bitstream, wherein the method comprises, when encodinga current picture of the video sequence: performing, by at least oneprocessor of an encoder: calculating an indication to a previousreference picture located before the current picture in decoding order,wherein the previous reference picture is, relatively to the currentpicture, a closest previous reference picture, in decoding order;creating a first set of indicators to previous pictures, wherein thefirst set comprises: the indication of the previous reference picture, asecond set of indicators to all reference pictures included in a firstreference picture set, “RPS”, of the previous reference picture, and athird set of indicators to all pictures in the first RPS that follow theprevious reference picture in decoding order and precede the currentpicture in decoding order; and based on a long term reference picture ina second RPS of the current picture having least significant bits of apicture order count, for which zero or only one picture indicated in thefirst set share the same value of the least significant bits of pictureorder count as the long term reference picture, clearing a flag for thelong term reference picture, wherein the flag indicates use of a pictureorder count cycle and least significant bits of the picture order countto indicate the long term reference picture in the second RPS.
 2. Themethod according to claim 1, wherein each picture of the bitstreamcomprises at least one network abstraction layer, “NAL”, unit, whereineach picture in the first RPS is encoded into at least one slicecomprised in said at least one NAL unit, wherein the at least one sliceeach comprises a slice header, wherein the slice header comprises theflag, the method further comprising performing by the at least oneprocessor encoding the current picture of the video sequence into atleast one current slice, wherein the at least one current slice isencoded into a current NAL unit.
 3. The method according to claim 2, themethod further comprising performing by the at least one processor:encoding the picture order count cycle into the current NAL unit of thecurrent picture.
 4. The method according to claim 2, wherein thetemporal identity of the previous reference picture is indicated in aprevious NAL unit of the previous reference picture.
 5. The methodaccording to claim 2, wherein the first reference picture set iscomprised in a previous slice header of the previous reference picture.6. The method according to claim 1, wherein the picture order countindicates an order in which pictures of the video sequence are to beoutput.
 7. An encoder configured to encode a video sequence into abitstream, wherein the bitstream is a High Efficiency Video Coding“HEVC” compliant bitstream, wherein the encoder comprises: at least oneprocessor; and a memory coupled to the at least one processor andstoring computer readable program code that is executable by the atleast one processor to perform, when encoding a current picture of thevideo sequence: calculate an indication to a previous reference picturelocated before the current picture in decoding order, wherein theprevious reference picture is, relatively to the current picture, aclosest previous reference picture, in decoding order; create a firstset of indicators to previous pictures, wherein the first set comprises:the indication to the previous reference picture, a second set ofindicators to all reference pictures included in a first referencepicture set, “RPS”, of the previous reference picture, and a third setof indicators to all pictures in the RPS that follow the previousreference picture in decoding order and precede the current picture indecoding order; and based on a long term reference picture in a secondRPS of the current picture having least significant bits of a pictureorder count, for which zero or only one picture indicated in the firstset share the same value of the least significant bits of picture ordercount as the long term reference picture, clearing a flag for the longterm reference picture, wherein the flag indicates use of a pictureorder count cycle and least significant bits of the picture order countto indicate the long term reference picture in the second RPS.
 8. Theencoder according to claim 7, wherein each picture of the bitstreamcomprises at least one network abstraction layer, “NAL”, unit, whereineach picture in the first RPS is encoded into at least one slicecomprised in said at least one NAL unit, wherein the at least one sliceeach comprises a slice header, wherein the slice header comprises theflag, wherein the at least one processor is further configured by thecomputer readable program code to encode the current picture of thevideo sequence into at least one current slice, and encode the at leastone current slice into a current NAL unit.
 9. The encoder according toclaim 8, wherein the at least one processor is further configured by thecomputer readable program code to encode the picture order count cycleinto the current NAL unit of the current picture.
 10. The encoderaccording to claim 8, wherein the temporal identity of the previousreference picture is indicated in a previous NAL unit of the previousreference picture.
 11. The encoder according to claim 8, wherein thefirst reference picture set is comprised in a previous slice header ofthe previous reference picture.
 12. The encoder according to claim 7wherein the picture order count indicates order in which pictures of thevideo sequence are to be output.
 13. A computer program productcomprising a non-transitory computer readable medium storing computerreadable program code which when executed by at least one processor ofan encoder causes the encoder to perform operations comprising:calculating an indication to a previous reference picture located beforethe current picture in decoding order, wherein the previous referencepicture is, relatively to the current picture, a closest previousreference picture, in decoding order; creating a first set of indicatorsto previous pictures, wherein the first set comprises: the indication ofthe previous reference picture, a second set of indicators to allreference pictures included in a first reference picture set, “RPS”, ofthe previous reference picture, and a third set of indicators to allpictures in the first RPS that follow the previous reference picture indecoding order and precede the current picture in decoding order; andbased on a long term reference picture in a second RPS of the currentpicture having least significant bits of a picture order count, forwhich zero or only one picture indicated in the first set share the samevalue of the least significant bits of picture order count as the longterm reference picture, clearing a flag for the long term referencepicture, wherein the flag indicates use of a picture order count cycleand least significant bits of the picture order count to indicate thelong term reference picture in the second RPS.
 14. The computer programproduct according to claim 13, wherein each picture of the bitstreamcomprises at least one network abstraction layer, “NAL”, unit, whereineach picture in the first RPS is encoded into at least one slicecomprised in said at least one NAL unit, wherein the at least one sliceeach comprises a slice header, wherein the slice header comprises theflag, the non-transitory computer readable medium storing furthercomputer readable program code which when executed by at least oneprocessor of an encoder causes the encoder to perform operations furthercomprising performing by the at least one processor encoding the currentpicture of the video sequence into at least one current slice, whereinthe at least one current slice is encoded into a current NAL unit. 15.The computer program product according to claim 14, the non-transitorycomputer readable medium storing computer readable program code whichwhen executed by at least one processor of an encoder causes the encoderto perform operations further comprising: encoding the picture ordercount cycle into the current NAL unit of the current picture.
 16. Thecomputer program product according to claim 14, wherein the temporalidentity of the previous reference picture is indicated in a previousNAL unit of the previous reference picture.
 17. The computer programproduct according to claim 14, wherein the first reference picture setis comprised in a previous slice header of the previous referencepicture.
 18. The computer program product according to claim 13, whereinthe picture order count indicates an order in which pictures of thevideo sequence are to be output.